import axios from 'axios'
import NProgress from 'nprogress'
const axiosIns = axios.create({
    baseURL: '/mock',
    timeout: 7000
})
axiosIns.interceptors.request.use(config => {
    //请求前
    NProgress.start();
    return config;
}, error => {
    return Promise.reject(error);
});

axiosIns.interceptors.response.use(response => {
    //请求成功
    NProgress.done();
    return response.data;
}, error => {
    //请求失败
    NProgress.done();
    return Promise.reject(error);
});
export default axiosIns